package com.dx.as.buriedpoint.actions;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.dx.as.buriedpoint.bean.ActiveInfo;
import com.dx.as.buriedpoint.bean.AppInfo;
import com.dx.as.buriedpoint.bean.CrashInfo;
import com.dx.as.buriedpoint.bean.EventInfo;
import com.dx.as.buriedpoint.bean.LogInfo;

import java.util.List;

/**
 * Created by jwaoo on 2017/6/19.
 */
@Dao
public interface ActionsDao {
    @Insert
    void insertActiveInfo(ActiveInfo activeInfo);

    @Insert
    void insertAppInfo(AppInfo appInfo);

    @Insert
    void insertEventInfo(EventInfo eventInfo);

    @Query("SELECT * FROM appInfo")
    List<AppInfo> queryAllAppInfo();

    @Query("SELECT * FROM activeinfo")
    List<ActiveInfo> queryAllActive();

    @Query("SELECT * FROM eventInfo")
    List<EventInfo> queryAllEventInfo();

    @Update
    void updateActiveInfo(ActiveInfo activeInfo);

    @Update
    void updateAppInfo(AppInfo appInfo);

    @Insert
    void insertCrashInfo(CrashInfo crashInfo);

    @Query("SELECT * FROM crashInfo")
    List<CrashInfo> queryAllCrashInfo();

    @Insert
    void insertLogInfo(LogInfo logInfo);

    @Query("SELECT * FROM logInfo")
    List<LogInfo> queryAllLogInfo();
}
